﻿var bw;

!function(a) {
    return this.version = "@1.1", this.layer = {
        width: 200,
        height: 100
    }, this.title = uncompile(quiLanguage.messager.title), this.time = 4e3, this.anims = {
        type: "slide",
        speed: 600
    }, this.inits = function(a, b) {
        var c, d, e, f;
        $("#message").is("div") || (c = $('<div id="message" style="z-index:800;width:' + this.layer.width + 'px;position:absolute; display:none;bottom:0px; right:1px; overflow:hidden;"></div>'), 
        d = $('<div class="msg_topcenter"><div class="msg_topleft"><div class="msg_topright"><div class="msg_title">' + a + '</div><div class="msg_close" id="message_close"></div></div></div></div>'), 
        e = $('<div class="msg_middlecenter"><div class="msg_middleleft"><div class="msg_middleright"><div class="boxContent" style="height:' + (this.layer.height - 35) + 'px;">' + b + "</div></div></div></div>"), 
        f = $('<div class="msg_bottomcenter"><div class="msg_bottomleft"><div class="msg_bottomright"></div></div></div>'), 
        c.append(d).append(e).append(f), $(document.body).append(c));
    }, this.show = function(a, b, c, d, e) {
        if (!$("#message").is("div")) {
            switch (0 != a && a || (a = this.title), this.inits(a, b), c && (this.time = c), 
            null != e && "" != e ? $("#message").addClass(e) : $("#message").addClass("box_msg"), 
            this.anims.type) {
              case "slide":
                $("#message").slideDown(this.anims.speed);
                break;

              case "fade":
                $("#message").fadeIn(this.anims.speed);
                break;

              case "show":
                $("#message").show(this.anims.speed);
                break;

              default:
                $("#message").slideDown(this.anims.speed);
            }
            if ($("#message_close").click(function() {
                mesclose();
            }), null != d && "" != d) try {
                var f = $("<embed src=" + d + "  AutoStart='true' type='application/x-mplayer2'></embed>");
                $("body").append(f);
            } catch (g) {}
            this.rmmessage(this.time);
        }
    }, this.lays = function(a, b) {
        $("#message").is("div") || (0 != a && a && (this.layer.width = a), 0 != b && b && (this.layer.height = b));
    }, this.anim = function(a, b) {
        if (!$("#message").is("div") && (0 != a && a && (this.anims.type = a), 0 != b && b)) switch (b) {
          case "slow":
            break;

          case "fast":
            this.anims.speed = 200;
            break;

          case "normal":
            this.anims.speed = 400;
            break;

          default:
            this.anims.speed = b;
        }
    }, this.rmmessage = function(a) {
        "stay" != a && (bw = setTimeout("mesclose()", a));
    }, this.mesclose = function() {
        switch (clearTimeout(bw), this.anims.type) {
          case "slide":
            $("#message").slideUp(this.anims.speed);
            break;

          case "fade":
            $("#message").fadeOut(this.anims.speed);
            break;

          case "show":
            $("#message").hide(this.anims.speed);
            break;

          default:
            $("#message").slideUp(this.anims.speed);
        }
        setTimeout('$("#message").remove();', this.anims.speed), setTimeout('$("#messageSound").remove();', this.anims.speed), 
        this.original();
    }, this.original = function() {
        this.layer = {
            width: 200,
            height: 100
        }, this.title = uncompile(quiLanguage.messager.title), this.time = 4e3, this.anims = {
            type: "slide",
            speed: 600
        };
    }, a.messager = this, a;
}(jQuery);